SET(CROSS_COMPILE 1)

IF(CROSS_COMPILE) 
  
SET(CMAKE_SYSTEM_NAME Linux)
SET(TOOLCHAIN_BIN "/usr/bin")
SET(TOOLCHAIN_DIR "/usr/aarch64-linux-gnu")

set(CMAKE_CXX_COMPILER ${TOOLCHAIN_BIN}/aarch64-linux-gnu-g++-9)
set(CMAKE_C_COMPILER   ${TOOLCHAIN_BIN}/aarch64-linux-gnu-gcc-9)
#set(GNU_FLAGS "-mfpu=vfp -fPIC")
set(GNU_FLAGS "-fPIC")
set(CMAKE_CXX_FLAGS "${GNU_FLAGS} -std=c++11 -pthread")
set(CMAKE_C_FLAGS "${GNU_FLAGS}  ")

SET(CMAKE_FIND_ROOT_PATH  ${TOOLCHAIN_DIR}
    ${TOOLCHAIN_DIR}/include
    ${TOOLCHAIN_DIR}/include/c++/9/bits
    ${TOOLCHAIN_DIR}/lib)

include_directories(/opt/aarch64_platform/include)
link_directories(/opt/aarch64_platform/lib)

ENDIF(CROSS_COMPILE)


